import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class 好数 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int num = scan.nextInt();
        int res = 0;
        for (int i = 1; i <= num; i++) {
            res += isGoodNum(i);
        }
        System.out.println(res);
        scan.close();
    }

    private static int isGoodNum(int num) {
        String str = String.valueOf(num);
        //先看奇数位
        for (int i = str.length() - 1; i >= 0; i -= 2) {
            if (Integer.parseInt(str.charAt(i) + "") % 2 != 0) {
                continue;
            } else return 0;
        }
        //再看偶数位
        for (int i = str.length() - 2; i >= 0; i -= 2) {
            if (Integer.parseInt(str.charAt(i) + "") % 2 == 0) {
                continue;
            } else return 0;
        }
        return 1;
    }
}